
export default [
    //主页
    {
        name: 'home',
        path: '/home',
        component: () => import('@/pages/Home'),
        meta:{showTabbar:true}
    },
    // 搜索
    {
        name: 'Search',
        path: '/search',
        component: () => import('@/pages/Search/SearchIndex'),
    },
    // 搜索详情页
    {
        name: 'SearchDetail', // 路由的标识名称 => 用于权限控制
        path: '/searchDetail', // 路由路径
        component: () => import('@/pages/Search/SearchDetail'), // 分类管理的路由组件
    },
    //登录
    {
        name: 'login',
        path: '/login',
        component: () => import('@/pages/Login'),
    },
  
    //分类
    {
        name: 'category',
        path: '/category',
        component: () => import('@/pages/Category'),
        meta:{showTabbar:true}
    },
    //个人中心
    {
        name: 'personal',
        path: '/personal',
        component: () => import('@/pages/Personal'),
        meta:{showTabbar:true}
    },
 
    //值得买
    {
        name: 'worth',
        path: '/worth',
        component: () => import('@/pages/Waterfall'),
        meta:{showTabbar:true}
    },
    //注册
    {
        name: 'register',
        path: '/register',
        component: () => import('@/pages/Register'),
    },
    //商品详情页
    {
        name: 'detail',
        path: '/detail',
        component: () => import('@/pages/Detail'),
    },
    {
        name: 'pay',
        path: '/pay',
        component: () => import('@/pages/Pay'),
        beforeEnter: (to, from, next) => {
			if(from.path === '/cart'){
				next()
			}else{
				next('/home')
			}
		},
    },
    {
        name: 'cart',
        path: '/cart',
        component: () => import('@/pages/Cart'),
        meta:{showTabbar:true}
    },
    {
        name: 'order',
        path: '/order',
        component: () => import('@/pages/Order'),
    },
    {
        name: 'trade',
        path: '/trade',
        component: () => import('@/pages/Trade'),
    },
    {
        path: '/',
        redirect: '/home'
    },
    //从分类页面跳转
    {
        name: 'categorylist',
        path: '/categorylist',
        component: () => import('@/components/categoryList'),
    },
    
]